package it.pride.primefacesShowcase.controller;

import it.pride.primefacesShowcase.service.UserService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

/**
 * Created by IntelliJ IDEA.
 * User: lbonacina
 * Date: 4-nov-2010
 * Time: 17.26.58
 */
@Controller(value = "basicDatatable")
@Scope("session")
public class BasicDatatableController {

    private static Logger logger = Logger.getLogger(BasicDatatableController.class.getName());

    @Autowired
    private UserService userService;

    private UsersDataModel usersDataModel;

    public void init() {

        usersDataModel = new UsersDataModel();
        usersDataModel.setWrappedData(userService.findAll());
    }

    public UsersDataModel getUsersDataModel() {
        return usersDataModel;
    }

    public void setUsersDataModel(UsersDataModel usersDataModel) {
        this.usersDataModel = usersDataModel;
    }
}
